📘 Python Knowledge Organiser – Revision Guide

🧠 Core Python Skills

This knowledge organiser summarises the Python programming skills you have practised in this lesson.

You should be able to read, write, and explain programs that use these skills.


⌨️ Inputs, Outputs and Variables

What is a variable?

Inputs and outputs

name = input("Enter your name: ")
print(f"Hello {name}")

Why this works: The input is stored in a variable and reused in the output.


🔢 Casting Data Types

Why casting is needed

Common data types

num = int(input("Enter a number: "))
print(num * 2)

Exam reminder: Without int(), Python treats numbers as text.


🔀 Selection (IF / ELIF / ELSE)

What is selection?

How it works

colour = input("Enter a colour: ")

if colour.lower() == "red":
    print("Correct")
elif colour.lower() == "blue":
    print("Correct")
else:
    print("Incorrect")

Why .lower() matters: It avoids errors caused by capital letters.


🔁 While Loops

What is a while loop?

When to use it

password = input("Enter password: ")

while password != "Secret123":
    print("Incorrect")
    password = input("Try again: ")

print("Password accepted")

Important rule: The variable used in the condition must be updated.


🔂 while True Loops

What does while True mean?

How does it stop?

while True:
    guess = input("Enter a colour: ")
    if guess.lower() == "red":
        print("Correct")
        break
    else:
        print("Incorrect")

Exam tip: Always explain where and why the loop ends.


🔢 For Loops

What is a for loop?

Understanding range()

for i in range(1, 13):
    print(f"{i} x 8 = {i * 8}")

Common error: Expecting the loop to include the final value.


📋 1D Lists

What is a list?

Indexing

sports = ["Shotput", "Javelin", "Diving"]

for i in range(0, 3):
    print(sports[i])

Exam tip: Index values always start at 0.


🧮 2D Lists

What is a 2D list?

Accessing values

landmarks = [
    ["Eiffel Tower", "Paris"],
    ["Big Ben", "London"],
    ["Sagrada Familia", "Barcelona"]
]

print(landmarks[0][0])
print(landmarks[0][1])

Outputs:

Eiffel Tower
Paris

Searching a 2D list

for i in range(0, len(landmarks)):
    if landmarks[i][1] == "Paris":
        print(landmarks[i][0])

Outputs:

Eiffel Tower